﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Document_Management.tianche;
namespace Document_Management
{
    public partial class frm天車部門 : Form
    {
        TextBox tx;
        public frm天車部門(TextBox tx)
        {
            InitializeComponent();
            this.tx = tx;
        }
  
        private void 天車部門_Load(object sender, EventArgs e)
        {
            PublicClass.LoadAllNoneProcedure("天車部門", _dtgv天車部門);

        }
            
        private void _dtgv天車部門_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            PublicClass.setRowNumber(_dtgv天車部門);
        }

        private void btn_OK_Click(object sender, EventArgs e)
        {
            try
            {
                int r = _dtgv天車部門.CurrentCell.RowIndex;
                string id = _dtgv天車部門.Rows[r].Cells[0].Value.ToString();
                tx.Text = id;
                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
    }
}
